import {ICommand} from './Commands';

class Invoker {
  command: ICommand = null;
  constructor(){
    console.log('初始化一个调用者');
  }

  setCommand(command:ICommand):void{
    console.log('设置命令：'+command.commandName);
    this.command = command;
  }

  call(): void {
    this.command.execute();
  }
}

export default Invoker;